<script type="text/javascript" src="<?php echo js_link("order.js","admin");?>"></script>
<?php echo $this->message->display();?>
<h1>All Oder</h1>
<div class="toppage">
       <span class="left">
	        <input type="text" name="keys" id="keys" value="<?php echo $keyword;?>" onblur="if(this.value=='') this.value='Keyword';" onfocus="if(this.value=='Keyword') this.value='';" style="width:165px; padding:3px;" />
            <select style="width:130px; line-height:25px;" id="id_select">
<?php 
			foreach($field_search as $key=>$val)
			{
?>
            <option value="<?php echo $key;?>" <?php echo ($key == $field) ? "selected=\"selected\"" : "";?>><?php echo $val;?></option>
<?php 
			}
?>
            </select>
            <input type="hidden" name="base_url" value="<?php echo admin_url("customer");?>" id="base_url" />
            <input type="submit" name="" value="Filter" class="btn" id="filter_button" />
        </span>
</div>
<div class="topart">
    	<span class="left">
    		
    		<font class="number">(<?php echo $total_order;?>)</font> <a href="<?php echo admin_url("customer/all_order");?>">All Oder</a><font class="line">|</font>
			<font class="number">(<?php echo $under_payment;?>)</font> <a href="<?php echo admin_url("customer/all_order?pay_stt=Under_Payment");?>"><font color="#0b9901">Under Payment</font></a><font class="line">|</font>
			<font class="number">(<?php echo $paid;?>)</font> <a href="<?php echo admin_url("customer/all_order?pay_stt=Paid");?>"><font color="#0b9901">Paid</font></a><font class="line">|</font>
			<font class="number">(<?php echo $finish_booked;?>)</font> <a href="<?php echo admin_url("customer/all_order?pay_stt=Finish_Booked");?>"><font color="#0b9901">Finish Booked</font></a><font class="line">|</font>
			<font class="number">(<?php echo $pending_ref;?>)</font> <a href="<?php echo admin_url("customer/all_order?pay_stt=Pending_Payment");?>"><font color="#0b9901">Pending Refund</font></a><font class="line">|</font>
			<font class="number">(<?php echo $refund;?>)</font> <a href="<?php echo admin_url("customer/all_order?pay_stt=Refund");?>"><font color="#0b9901">Refund</font></a>
        </span>
        <span class="right1">
        	<select style="width:50px;" id="num_record_display">
            	<option value="1">30</option>
                <option value="2">50</option>
                <option value="3">100</option>
            </select>
            <div class="pagination">
<?php 
			echo $pagnav;	
?>
            </div>
        </span>
</div>
<div class="tableout">
		<!-- Title -->
		<div class="title1">
        	<div class="column" style="width:2%;"><input disabled="disabled" type="checkbox" name="check_all_02" value="" id="check_all_01" /></div>
            <div class="column" style="width:8%;">Oder ID</div>
            <div class="column" style="width:22%;">Customer Name</div>
            <div class="column" style="width:18%;">Tour Code - City</div>
            <div class="column" style="width:5%;">Price</div>
            <div class="column" style="width:8%;">Oder date</div>
            <div class="column" style="width:18%;">Country</div>
            <div class="column" style="width:10%;">Admin</div>
            <div class="column" style="width:8%;">Status</div>
        </div>
        <!-- List -->
<?php 
		foreach($list_order as $order)
		{
?>
		<div class="linecate2">
        	<div class="column" style="width:2%;"><input disabled="disabled" type="checkbox" name="order_id[]" id="order_id[]" value="<?php echo $order["id"];?>" <?php echo set_checkbox('order_id', $order["id"]); ?> /></div>
            <div class="column" style="width:8%;"><a href="#"><?php echo $order["id"];?></a></div>
            <div class="column" style="width:22%;">
            	<a href="javascript:void(0);" class="art" onclick="view_cus('<?php echo admin_url('customer/customers_edit?cus_id='.$order['cus_id'].'&view=yes')?>')"><?php echo trim($order["title"]). " " . trim($order["fullname"]);?></a><br />
            </div>
            <div class="column" style="width:18%;">
            	<a href="<?php echo admin_url('tour/edit?id='.$order['tour_id']);?>" class="art" target="_blank"><?php echo $order["code"];?></a> - <?php echo $order["destination"];?>
            </div>
            <div class="column" style="width:4%;">
            	<font color="#FF0000">$<?php echo $order["total_price"];?></font>
            </div>
            <div class="column" style="width:8%;">
            	<?php echo time_format($order["date_create"], "day");?>
            </div>
            <div class="column" style="width:18%;">
            	<?php echo $order["country"];?> - <font color="#777"><?php echo $order["ip_address"];?></font>
            </div>
            <div class="column" style="width:9%;"><?php echo $order["user_process"];?></div>
            <div class="column" style="width:9%;">
            	<?php echo $order["pay_status"];?>
            </div>
        </div>
<?php 
		}
?>
        <!-- Bottom -->
        <div class="bottom1">
            <span class="right1">
                <div class="pagination">
<?php 
				echo $pagnav;
?>
                </div>
            </span>
        </div>
</div>
<div id="light" class="white_content">
	<div class="editart_top">
		<span class="left3">
		<h2>Edit customer</h2>
	    </span>
		<a href = "javascript:void(0)" onclick ="document.getElementById('light').style.display='none';document.getElementById('fade').style.display='none'"><img src="<?php echo img_link("close.png", "admin")?>" class="png" /></a>
    </div>
    <form action="<?php echo admin_url('customer/customers')?>" method="post" id="edit_cus">
		<div class="editcate_ct" id="content">
			
		    
		</div>
		<div class="btarticle">
	    	<input type="button" name="close" value="Cancel" class="btn" />
	        <input type="submit" name="" value="Save & Continute" class="btn" />
	    </div>
	</form>
</div>
<div id="fade" class="black_overlay"></div>